﻿using BCGPSCommon;
using Microsoft.Extensions.Configuration;
using System.IO; 


namespace BCGPS.DataReceive.Service
{
    public class ConfigurationManager
    {
        private static IConfigurationRoot config;
        public static IConfigurationRoot AppSettings { get { return config; } }
        public static string Get(string key)
        {
            return config[key];
        }
        static ConfigurationManager()
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json",optional: true, reloadOnChange: true);
            config = builder.Build();

             
            GeneralContainer.RedisNameSpaceIMEISendCmd = AppSettings["Redis:RedisNameSpaceIMEISendCmd"]; 
        }
    }
}
